package com.moli.lumpSugar.api.client.user;

import com.moli.lumpSugar.api.domain.entity.black.Black;
import com.moli.lumpSugar.api.domain.entity.role.RoleEnum;
import com.moli.lumpSugar.api.domain.entity.user.User;
import com.moli.lumpSugar.api.domain.entity.user.UserRole;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("lumpSugar-user")
public interface UserClient {
    @GetMapping("/sapi/user/getUser")
    User getUser(@RequestParam("uid") Long id);

    @GetMapping("/sapi/user/getUserByOpenId")
    User getUserByOpenId(@RequestParam("openId") String openId);

    @GetMapping("/sapi/user/getUserByOpenId")
    List<User> getUserListByIds(@RequestParam("ids") List<Long> ids);

    @PostMapping("/sapi/user/updateUser")
    Boolean updateUser(User user);

    @GetMapping("/sapi/role/hasPower")
    Object hasPower(@RequestParam("uid") Long uid,@RequestParam("role") RoleEnum role);

    @GetMapping("/sapi/role/getUserRoles")
    Object getUserRoles(@RequestParam("uid") Long uid);

    @GetMapping("/sapi/black/getBlackList")
    List<Black> getBlackList();
}
